// DialogIntermediates.cpp : implementation file
//

#include "stdafx.h"
#include "testSVG.h"
#include "DialogIntermediates.h"
#include ".\dialogintermediates.h"

extern int UseLocalNetworkFlag;
extern char LocalNetwork[400];
// CDialogIntermediates dialog

IMPLEMENT_DYNAMIC(CDialogIntermediates, CDialog)
CDialogIntermediates::CDialogIntermediates(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogIntermediates::IDD, pParent)
{
}

CDialogIntermediates::~CDialogIntermediates()
{
}

void CDialogIntermediates::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CDialogIntermediates, CDialog)
	ON_BN_CLICKED(IDOK, OnBnClickedOk)
	ON_BN_CLICKED(IDC_BUTTON1, &CDialogIntermediates::OnBnClickedButton1)
END_MESSAGE_MAP()


// CDialogIntermediates message handlers

BOOL CDialogIntermediates::OnInitDialog()
{
	CDialog::OnInitDialog();
	CComboBox* selectionCtrl;

	selectionCtrl = (CComboBox*) GetDlgItem(IDC_COMBO_INTERMEDIATES);
	selectionCtrl->AddString("1");
	selectionCtrl->AddString("2");
	//selectionCtrl->AddString("3");
	//selectionCtrl->AddString("4");
	selectionCtrl->SetCurSel(0);
	// TODO: selectionCtrl- Add extra initialization here
	useLocal = 0;
	return TRUE;  // return TRUE unless you set the focus to a control
	
}

void CDialogIntermediates::OnBnClickedOk()
{
	CComboBox* selectionCtrl;

	selectionCtrl = (CComboBox*) GetDlgItem(IDC_COMBO_INTERMEDIATES);
	m_selection = selectionCtrl->GetCurSel() + 3;

	UseLocalNetworkFlag = useLocal;

	OnOK();
}

void CDialogIntermediates::OnBnClickedButton1()
{
	CFileDialog myDialog(TRUE, NULL, "*.sig", OFN_OVERWRITEPROMPT, NULL, NULL );

	myDialog.DoModal();

	strcpy(LocalNetwork, myDialog.m_ofn.lpstrFile);
	
	useLocal = 1;

	

}
